//#include <iostream>
//#include <string>
//#include <stack>
//#include <queue>
//#include <vector>
//#include <algorithm>
//using namespace std;
//
//
////https://leetcode-cn.com/problems/zheng-ze-biao-da-shi-pi-pei-lcof/solution/zhu-xing-xiang-xi-jiang-jie-you-qian-ru-shen-by-je/
//class Solution {
//public:
//    bool isMatch(string s, string p) {
//        int n = s.size();
//        int m = p.size();
//        //为了方便处理空串 结果为 dp[n][m]
//        vector<vector<bool>> dp(n+1,vector<bool>(m+1, false));
//
//
//    }
//};
//
//int main(){
//
//}

#include <iostream>
#include <string>

using namespace std;

string gfh(string str)
{
    string res;
    size_t pos = str.find(".");
    if (pos != string::npos)
    {
        int ipos = pos - 4;
        while (ipos >= 0)
        {
            if (str[ipos] >= '0' && str[ipos] <= '9')
                str.insert(str.begin() + ipos + 1, ',');
            ipos -= 3;
        }
        ipos = str.find(".");
        if( str.size() - ipos > 3)
            str.erase(str.begin() + pos + 3,str.end());
        else if(str.size() - ipos == 2)
        {
            str += "0";
        }
    }
    else
    {
        int ipos = str.size()-4;
        while (ipos >= 0)
        {
            if (str[ipos] >= '0' && str[ipos] <= '9')
                str.insert(str.begin() + ipos + 1, ',');
            ipos -= 3;
        }

        str += ".00";
    }

    if (str[0] == '-')
        res = "($" + str + ")";
    else
        res = "$" + str;
    return res;
}

int main()
{
    string str;
    while(cin >> str)
        cout << gfh(str)<<endl;
    return 0;
}